import React, { useEffect } from "react";
import ReactDOM from "react-dom/client";

function Index() {
  const element: any = <div>1111</div>;
  const a = (text: React.ReactNode) => {
    return <div>1111{text}</div>;
  };

  useEffect(() => {
    const dom: any = document.getElementById("aaa");
    const root = ReactDOM.createRoot(document.body); // 使用 React 18 的新特性 createRoot

    // 渲染 JSX 元素
    root.render(a(<div>222</div>));
  }, []);
  return <div id="aaa">Index</div>;
}

export default Index;
